package com.ruoyi.consumer.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consumer.mapper.CInvoiceHeaderMapper;
import com.ruoyi.consumer.domain.CInvoiceHeader;
import com.ruoyi.consumer.service.ICInvoiceHeaderService;

/**
 * 发票抬头Service业务层处理
 * 
 * @author lizhouwei
 * @date 2023-12-09
 */
@Service
public class CInvoiceHeaderServiceImpl implements ICInvoiceHeaderService 
{
    @Autowired
    private CInvoiceHeaderMapper cInvoiceHeaderMapper;

    /**
     * 查询发票抬头
     * 
     * @param invoiceId 发票抬头主键
     * @return 发票抬头
     */
    @Override
    public CInvoiceHeader selectCInvoiceHeaderByInvoiceId(Integer invoiceId)
    {
        return cInvoiceHeaderMapper.selectCInvoiceHeaderByInvoiceId(invoiceId);
    }

    /**
     * 查询发票抬头列表
     * 
     * @param cInvoiceHeader 发票抬头
     * @return 发票抬头
     */
    @Override
    public List<CInvoiceHeader> selectCInvoiceHeaderList(CInvoiceHeader cInvoiceHeader)
    {
        return cInvoiceHeaderMapper.selectCInvoiceHeaderList(cInvoiceHeader);
    }

    /**
     * 新增发票抬头
     * 
     * @param cInvoiceHeader 发票抬头
     * @return 结果
     */
    @Override
    public int insertCInvoiceHeader(CInvoiceHeader cInvoiceHeader)
    {
        cInvoiceHeader.setCreateTime(DateUtils.getNowDate());
        return cInvoiceHeaderMapper.insertCInvoiceHeader(cInvoiceHeader);
    }

    /**
     * 修改发票抬头
     * 
     * @param cInvoiceHeader 发票抬头
     * @return 结果
     */
    @Override
    public int updateCInvoiceHeader(CInvoiceHeader cInvoiceHeader)
    {
        cInvoiceHeader.setUpdateTime(DateUtils.getNowDate());
        return cInvoiceHeaderMapper.updateCInvoiceHeader(cInvoiceHeader);
    }

    /**
     * 批量删除发票抬头
     * 
     * @param invoiceIds 需要删除的发票抬头主键
     * @return 结果
     */
    @Override
    public int deleteCInvoiceHeaderByInvoiceIds(Integer[] invoiceIds)
    {
        return cInvoiceHeaderMapper.deleteCInvoiceHeaderByInvoiceIds(invoiceIds);
    }

    /**
     * 删除发票抬头信息
     * 
     * @param invoiceId 发票抬头主键
     * @return 结果
     */
    @Override
    public int deleteCInvoiceHeaderByInvoiceId(Integer invoiceId)
    {
        return cInvoiceHeaderMapper.deleteCInvoiceHeaderByInvoiceId(invoiceId);
    }
}
